import { _decorator ,AudioSource} from "cc";
 
const {ccclass,property}  = _decorator;

@ccclass("AudioEffect")
export class AudioEffect extends AudioSource{
    onCompleted:Function | null = null;
    protected start():void{
        this.node.on(AudioSource.EventType.ENDED, this.onAudioCompleted, this);
    }

    private onAudioCompleted():void{
        this.onCompleted && this.onCompleted();
    }
}